package com.xwt.pattern.builder;

/**
 * Author:  Steven Xiao
 * Description:最终客户开始使用这个模型
 * Date:  2016/3/21
 * Time:  16:48
 */
public class Client {

    public static void main(String[] args) {
//        ArrayList<String> sequence = new ArrayList<String>();//run的顺序
//        sequence.add("engine boom");
//        sequence.add("start");
//        sequence.add("stop");
//
//        BenzBuilder benzBuilder = new BenzBuilder();
//        benzBuilder.setSequence(sequence);
//        BenzModel benz = (BenzModel) benzBuilder.getCarModel();
//        benz.run();
//
//        BMWBuilder bmwBuilder = new BMWBuilder();
//        bmwBuilder.setSequence(sequence);
//        BMWModel bmw =(BMWModel)bmwBuilder.getCarModel();
//        bmw.run();

        Director director = new Director();
        for (int i = 0; i < 10000; i++) {
            director.getABenzModel().run();
        }

        for (int i = 0; i < 100; i++) {
            director.getBBenzModel().run();
        }

        for (int i = 0; i < 1000; i++) {
            director.getCBMWModel().run();
        }
    }

}
